﻿using System.Collections.Generic;
using System.Reflection;

namespace Chambills.Present.Core
{
    /// <summary>
    /// A repersentation of a property
    /// </summary>
    public class PropertyModel
    {
        public PropertyInfo Member { get; private set; }

        public PropertyModel(PropertyInfo property)
        {
            Member = property;
            DependentProperties = new List<PropertyModel>();
        }

        /// <summary>
        /// Properties whose value dependes onthis property
        /// </summary>
        public List<PropertyModel> DependentProperties { get; private set; }


        public string Name { get { return Member.Name; } }

        public object GetValue(object target)
        {
            return Member.GetValue(target, null);
        }
    }
}